package com.wzw.basics.encryption;

import com.sun.org.apache.xml.internal.security.exceptions.Base64DecodingException;
import com.sun.org.apache.xml.internal.security.utils.Base64;

import java.nio.charset.StandardCharsets;

/**
 * @author Wangzhiwen
 */
public class Base64Encryption {

    public static String encrypt(String data){
        return Base64.encode(data.getBytes(StandardCharsets.UTF_8));
    }

    public static byte[] decrypt(String data) throws Base64DecodingException {
        return Base64.decode(data.getBytes(StandardCharsets.UTF_8));
    }

}
